# Group Upload

This group of APIs contain endpoints for uploading media files. The workflow is different for images and any other files. In image, a temporary cropped image is first uploaded using the `Image Upload` endpoint. For other files, there can be a single file or multiple files for uploading.

## Image Upload [/v1/upload/image{?force_local}]

A temporary cropped image is first uploaded using this endpoint. After saving the image in it's prefered storage (local, google storage, s3, etc.), the URL for the temporary image is returned as response. This URL is then sent as form data to the necessary API, where it is then downloaded and resized and stored according to the need. *`force_local` parameter can be set to __true__ to force storage in local.*


### Upload an Image in temporary location [POST]

+ Parameters
    + force_local (optional, string, `true`) - Force storage of temporary image in local

+ Request

    + Headers

            Content-Type: application/json
            Authorization: JWT <Auth Key>

    + Body

            {
                "data": ""
            }

+ Response 200 (application/json)

        {
            "url":"/serve_static/media/temp/images/6a6614c7-d458-43de-a9bd-5c329e273bf0/U0lLbUt2SF/4d4dae9e-0bab-4e72-ba2f-e8e633a145e5.gif"
        }

## File Upload [/v1/upload/files{?force_local}]

This endpoint supports uploading of any kind of file or multiple files. If a single file is to be uploaded, send a single file in the keyword **file**, else if multiple files, send an array of files in the keyword **files**. After saving in it's prefered storage (local, google storage, s3, etc.), the URL or array of URLs returned as response. *`force_local` parameter can be set to __true__ to force storage in local.*


### Upload a File [POST]

+ Parameters
    + force_local (optional, string, `true`) - Force storage of temporary image in local

+ Request(multipart/form-data; boundary=---BOUNDARY)

        -----BOUNDARY
        Content-Disposition: form-data; name="file"; filename="test.csv"
        Content-Type: text/csv

+ Response 200 (application/json)

        {
            "url":"/serve_static/media/temp/images/6a6614c7-d458-43de-a9bd-5c329e273bf0/U0lLbUt2SF/4d4dae9e-0bab-4e72-ba2f-e8e633a145e5.gif"
        }
